package com.proactive.webapp.util;

import java.util.ArrayList;
import java.util.List;

public class Category {
	private String type;
	private String typeName;
	private String name1 = "全部分類";
	private String name2 = "全部分類";
	private int id1;
	private int id2;
	private String url;
	private String endUrl;
	private List<String> typeUrl;
	private List<String> typeClass;
	private List<String> name;
	
	public void inti(){
		switch(type){
			case "new":
				typeName = "最新";
				break;
			case "hot":
				typeName = "最熱";
				break;
			case "com":
				typeName = "評論";
				break;
			case "fav":
				typeName = "喜愛";
				break;
			case "col":
				typeName = "收藏";
				break;
			default:
				typeName = "最新";
				type = "new";
				break;
		}
	}
	
	public void set1(){
		name = new ArrayList<String>();
		typeUrl = new ArrayList<String>();
		typeClass = new ArrayList<String>();
		String typeName1[] = {"最新", "最熱", "評論", "喜愛"};
		String type1[] = {"new", "hot", "com", "fav"};
		for(int i=0; i<typeName1.length; i++){
			name.add(typeName1[i]);
			typeUrl.add(url+"?t="+type1[i]+endUrl);
			typeClass.add(type.equals(type1[i])?"selected":"");
		}
	}
	
	public void set2(){
		name = new ArrayList<String>();
		typeUrl = new ArrayList<String>();
		typeClass = new ArrayList<String>();
		String typeName2[] = {"最新", "最熱", "收藏"};
		String type2[] = {"new", "hot", "col"};
		for(int i=0; i<typeName2.length; i++){
			name.add(typeName2[i]);
			typeUrl.add(url+"?t="+type2[i]+endUrl);
			typeClass.add(type.equals(type2[i])?"selected":"");
		}
	}
	
	public Category(String type, int id1, int id2, String url, String endUrl) {
		super();
		this.type = type;
		this.id1 = id1;
		this.id2 = id2;
		this.url = url;
		this.endUrl = endUrl;
		inti();
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;		
	}
	public String getTypeName() {
		return typeName;
	}
	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}
	public String getName1() {
		return name1;
	}
	public void setName1(String name1) {
		this.name1 = name1;
	}
	public String getName2() {
		return name2;
	}
	public void setName2(String name2) {
		this.name2 = name2;
	}
	public int getId1() {
		return id1;
	}
	public void setId1(int id1) {
		this.id1 = id1;
	}
	public int getId2() {
		return id2;
	}
	public void setId2(int id2) {
		this.id2 = id2;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public List<String> getTypeUrl() {
		return typeUrl;
	}

	public void setTypeUrl(List<String> typeUrl) {
		this.typeUrl = typeUrl;
	}

	public List<String> getTypeClass() {
		return typeClass;
	}

	public void setTypeClass(List<String> typeClass) {
		this.typeClass = typeClass;
	}

	public List<String> getName() {
		return name;
	}

	public void setName(List<String> name) {
		this.name = name;
	}
	
	
}
